package com.ghck.shop.dao.provider;

import java.text.MessageFormat;
import java.util.List;
import java.util.Map;

public class HotCategoryMapperProvider {

	public String findCategoryByIds(Map<String, List<Integer>> map){
		StringBuffer sb = new StringBuffer();
		List<Integer> serviceCardCodes = map.get("list");
		MessageFormat messageFormat = new MessageFormat("#'{'list[{0}]}");
		sb.append("select * from category where id in");
		sb.append("(");
		int len = serviceCardCodes.size();
		for(int i=0;i<len;i++){
			sb.append(messageFormat.format(new Integer[]{i}));
			sb.append(",");
		}
		sb.setLength(sb.length() - 1);
		sb.append(")");
		return sb.toString();
	}
}
